1. Field of the Invention
This invention relates to emulating an environment""s drag and drop functionality in a host environment.
2. Background
OpenStep(trademark) is an open, high-volume portable standard for object-oriented computing. It provides a standard application programming interface (API). The OpenStep specification is based on NeXTStep. NeXTStep(trademark) is an object-oriented operating system of NeXT Computer, Inc.
The NeXTStep Window Server running in the NeXT environment is a low-level process that is responsible for drawing images to the screen and sending events to applications. The NeXTStep Window Server manages the screen, keyboard, and mouse.
The NeXTStep Window Server includes a Display Postscript interpreter that performs the actual drawing of lines, text, and pictures. Postscript is a device-independent graphics description language that processes commands to perform line drawing, typesetting, and image presentation on the screen and printer output.
In addition to providing graphic user interface (GUI) capabilities, NeXTStep provides an application development environment. In addition to the development environment, the NeXTStep Application Kit, or App Kit, provides object classes for providing functionality to an application.
The NeXTStep environment runs in the Mach operating system (OS). The Mach OS is a microkernel-based operating systems. A microkernel-based OS provides a basic level of services with the bulk of the operating system services supplied by user-level services. For example, the Mach kernel provides process management, memory management, communication and Input/Output services. Services such as files and directories are handled by user-level processes.
The communication service provided by the Mach OS uses a data structure called a port. A port is analogous to a mailbox. A sender (e.g., a thread, or executable subcomponent of a process) communicates with a receiver (e.g., thread of another process) by writing a message to the mailbox, or port. The receiver retrieves the sender""s message from the port.
In the above example, the sender""s message is not actually stored in the port. The message is stored in a message queue. The port contains a count of the number of messages in the message queue. When a port is created, an integer that identifies the port is sent back to the creator (e.g., a thread). The identifier is used to access the port to send or receive a message.
Solaris(trademark) is a UNIX operating environment that can run on multiple hardware platforms such as Intel x86, SPARC, and PowerPC processors. OpenWindows(trademark) is a windowing system based on the X11 windowing specification that runs in Solaris. The X11/DPS is a windowing system that runs in OpenWindows. Solaris, OpenWindows, and X11/DPS are products that are available from Sun Microsystems, Inc. (Sun Microsystems, Inc., OpenWindows, X11/DPS, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and certain other countries.)
Previous drag and drop functionality for use within a single environment has been described in articles such as Marks, Stuart W., Implementing Drag and Drop in X11, 5th Annual X Technical Conference (Sun 1991); Beged-Dov, G. and Cohen, Ellis S., Implementing Drag and Drop for X11, 6th Annual X Technical Conference (1992); and Marks, Stuart W., Drag-and-Drop Protocol Specification, OpenWindows Version 3. It would be beneficial to provide a drag and drop functionality for an environment that is emulated in a host environment.
For example, in an environment such as the NeXTStep environment, a xe2x80x9cfindWindowxe2x80x9d command is used to identify a window that is currently underneath the cursor. To emulate the drag and drop functionality of the NeXTStep environment, it would be beneficial to be able to locate a window during the drag and drop operation.
The NeXTStep environment provides alpha compositing. Alpha compositing specifies color and transparency percentages for images or icons on the screen. It would be beneficial to emulate the NeXTStep drag and drop operation such that the alpha compositing used in the NeXTStep environment is mapped to that used in a host environment.
An emulated environment may use modifier keys to specify a drag and drop operation that are different than those used in a host environment. It would be beneficial to map the host environment""s modifier keys to those used in the emulated environment.
Further, it would be beneficial to identify the windows of the host environment that have been registered in the emulated environment as potential drop sites.
The present invention supports drag and drop components of an emulated environment within a host environment. The look and feel of a drag and drop operation of the emulated environment is emulated in the host environment. A drag window is created from the emulated environment""s drag image. Modifier keys of the host environment are mapped to those used in the emulated environment. Windows are registered for drag and drop in the emulated environment""s registered windows database. The host environment""s window, or drag and drop, database is updated to identify the registered windows of the emulated environment.
The emulated environment maintains a registered windows database that includes an entry for each window of the emulated environment that wishes to be a drop site. When a drag and drop operation is initiated, a drag and drop database is created and updated to include all of the top level windows currently on the screen. The drag and drop database is updated to associate a top level window entry with an entry in the registered windows database. In addition to creating a drag and drop data, the emulated environment""s drag image is converted for use in the host environment, if necessary.
The current position of the drag image is compared to the entries in the drag and drop database to determine if a potential drop site is underneath the current position. The drag and drop database contains a registered window""s window geometry such as the window""s height, width and xe2x80x9cx and yxe2x80x9d coordinates. The window identifier (ID) of a potential drop site is used to retrieve an port identifier (ID). The port ID can be used to communicate with the application associated with the drop site.
During the drag and drop operation, the host environment transmits a status message to the emulated environment. The status message can include the window ID, port ID, xe2x80x9cx and yxe2x80x9d coordinates, and window height and width. The emulated environment can process the status message. For example, the emulated environment can forward the message to the application via a port identified by the port ID.